var fs = require('fs');
process.chdir('C:\\Users\\DongDong\\Desktop\\flash特效整理')
fs.readdir(process.cwd(), function(err, file){
    if(err){
        console.log(err);
    }else{
        for(var i=0; i<file.length; i++){
            var b = file[i].replace('-', ' ');
            console.log(b);
            fs.rename(file[i], b, function(err){
                if(err){
                    throw err;
                }else{
                    console.log('done');
                }
            });
        }
    }
});


function addPreZero(num){
 if(num<10){
  return '000'+num;
 }else if(num<100){
  return '00'+num;
 }else if(num<1000){
  return '0'+num;
 }else{
  return num;
 }
}